import React, { Component, createContext } from 'react'
// const { Consumer } = createContext()
import { Consumer } from '../utils/context'


export default class Son extends Component {
    render() {
        return (
            <div>
                {/* Consumer组件必须写一个函数 */}
                <Consumer>
                    {
                        (data) => {
                            return <h3>我是子组件 -- { data }</h3>
                        }
                    }
                </Consumer>
            </div>
        )
    }
}